from selenium.webdriver.common.by import By

from seleniumTask.po.add_member_page import AddMemeberPage
from seleniumTask.po.base_page import BasePage


class ContactPage(BasePage):
    def goto_add_member(self):
        """
        跳转到添加成员页面
        :return:
        """
        return AddMemeberPage

    def get_member_list(self):
        """
        获取成员列表
        :return:返回用于断言的成员列表信息
        """
        #注意获取列表的时候要用find_elements而不是find_element
        ele = self.driver.find_elements(By.CSS_SELECTOR, ".member_colRight_memberTable_td:nth-child(2)")
        #通过列表推导式获取列表信息
        name_list = [i.text for i in ele]
        print(name_list)
        return name_list